.assistant-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  
  .panel-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
  }
  
  .panel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    animation: slideUp 0.3s ease-out;
    
    .panel-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
      
      h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #333;
      }
      
      .close-btn {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #666;
        padding: 4px;
        
        &:hover {
          color: #333;
        }
      }
    }
    
    .input-section {
      margin-bottom: 20px;
      
      .text-input {
        width: 100%;
        min-height: 80px;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 14px;
        resize: vertical;
        font-family: inherit;
        
        &:focus {
          outline: none;
          border-color: #667eea;
          box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
        }
      }
      
      .input-actions {
        display: flex;
        gap: 8px;
        margin-top: 8px;
        
        button {
          padding: 6px 12px;
          border: 1px solid #ddd;
          border-radius: 6px;
          background: white;
          font-size: 12px;
          cursor: pointer;
          transition: all 0.2s;
          
          &:hover:not(:disabled) {
            background: #f5f5f5;
            border-color: #ccc;
          }
          
          &:disabled {
            opacity: 0.5;
            cursor: not-allowed;
          }
        }
      }
    }
    
    .preset-grid {
      margin-bottom: 20px;
      
      .category-section {
        margin-bottom: 16px;
        
        .category-btn {
          display: flex;
          align-items: center;
          gap: 8px;
          width: 100%;
          padding: 12px 16px;
          border: 1px solid #ddd;
          border-radius: 8px;
          background: white;
          cursor: pointer;
          transition: all 0.2s;
          
          &:hover {
            background: #f8f9ff;
            border-color: #667eea;
          }
          
          &.active {
            background: #667eea;
            border-color: #667eea;
            color: white;
          }
          
          .category-icon {
            font-size: 20px;
          }
          
          .category-name {
            font-size: 14px;
            font-weight: 500;
          }
        }
        
        .prompts-section {
          margin-top: 8px;
          display: flex;
          flex-wrap: wrap;
          gap: 8px;
          
          .prompt-btn {
            padding: 8px 12px;
            border: 1px solid #667eea;
            border-radius: 6px;
            background: white;
            color: #667eea;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            
            &:hover:not(:disabled) {
              background: #667eea;
              color: white;
            }
            
            &:disabled {
              opacity: 0.5;
              cursor: not-allowed;
            }
          }
        }
      }
    }
    
    .results-section {
      margin-bottom: 20px;
      
      h4 {
        margin: 0 0 12px 0;
        font-size: 16px;
        font-weight: 600;
        color: #333;
      }
      
      .result-item {
        background: #f8f9ff;
        border: 1px solid #e0e7ff;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 8px;
        
        .result-text {
          font-size: 14px;
          line-height: 1.5;
          margin-bottom: 8px;
          color: #333;
        }
        
        .copy-btn {
          padding: 4px 8px;
          border: 1px solid #667eea;
          border-radius: 4px;
          background: white;
          color: #667eea;
          font-size: 12px;
          cursor: pointer;
          transition: all 0.2s;
          
          &:hover {
            background: #667eea;
            color: white;
          }
        }
      }
    }
    
    .loading-section {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 20px;
      color: #666;
      
      .loading-spinner {
        animation: spin 1s linear infinite;
      }
    }
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
  .assistant-panel .panel-content {
    background: #1a1a1a;
    color: white;
    
    .panel-header h3 {
      color: white;
    }
    
    .text-input {
      background: #2a2a2a;
      border-color: #444;
      color: white;
      
      &:focus {
        border-color: #667eea;
      }
    }
    
    .category-btn {
      background: #2a2a2a;
      border-color: #444;
      color: white;
      
      &:hover {
        background: #3a3a4a;
      }
    }
    
    .result-item {
      background: #2a2a2a;
      border-color: #444;
      
      .result-text {
        color: white;
      }
    }
  }
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
  .assistant-panel .panel-content {
    padding-bottom: max(20px, env(safe-area-inset-bottom) + 20px);
  }
}
